

package UCH.JAVA.UTIL;
import  java.sql.*;
public class ConexionBD {


   public   static void  main(String args[])
    {
       ConexionBD   obj=new  ConexionBD();
                    obj.getConexionBD();

    }

     public  Connection  getConexionBD()

     {
     Connection   cn=null;
      try {
          Class.forName("com.mysql.jdbc.Driver");
         // Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

         cn=DriverManager.getConnection("jdbc:mysql://localhost/biblioteca","jtejada","123456");
          //cn=DriverManager.getConnection("jdbc:odbc:UCH");
          System.out.println("SE CONECTO");

      } catch (Exception e) {
            System.out.println("NO SE CONECTO");
      }

     return  cn;

 }



}
